Conventionally, games are known in which an image of a 3-dimensional virtual game space taken by a virtual camera is presented as a game image. In addition, some of these games perform movement control for the virtual camera so as to display a game screen like a horizontal scroll game with horizontal vision or a vertical scroll game, for example.
In the case where the screen vision is for a horizontal scroll game with horizontal vision as described above and its game space is configured as a 3-dimensional space, basically, an image is taken such that a player character is viewed just forward from the virtual camera. The virtual camera moves in the horizontal direction so as to follow movement of the player character. For example, if the player character is moved rightward as seen from a player, the virtual camera also moves horizontally rightward as seen from the player. As a result, for example, a game image in which the player character is always positioned at the center of the game screen is displayed.
Here, in the case where the virtual camera is moved in the above manner, it will be assumed that there is an object (for example, wall object) as an obstacle in the movement direction of the virtual camera. FIG. 20 is a schematic diagram showing a virtual game space as seen from above, for explaining such a state. In the state shown in FIG. 20, if the player character moves rightward, along with this, the virtual camera also moves rightward so as to keep catching the player character from the front. As a result, as shown in FIG. 21, the virtual camera enters the inside of an obstacle object. As a result, the player character cannot be viewed from the virtual camera because the virtual camera's view is blocked by the obstacle object, and for example, the back surface of the obstacle object is displayed as a game image, which may cause a trouble to a player in playing the game.
In the above case, for example, it is conceivable to move the virtual camera instantaneously to a position outside the obstacle object at a timing when the virtual camera has entered the inside of the obstacle object. However, in this case, the screen is rapidly switched, thereby giving a feeling of strangeness to a player. Instead, it is also conceivable to gradually move the virtual camera to the outside of the obstacle object from the timing when the virtual camera has entered the inside of the obstacle object. However, also in this case, during several frames until the virtual camera moves to the outside after the virtual camera has entered the inside the obstacle object, a game image of the state in which the virtual camera is inside the obstacle object is presented to a player, and therefore the player is to feel strangeness and difficulty in viewing the screen.
Therefore, the exemplary embodiments will be described to provide an information processing program, an information processing system, an information processing apparatus, and an information processing method that are capable of, even when there is an obstacle or the like near a virtual camera, performing movement control of the virtual camera so as to provide an image of a virtual space without giving a feeling of strangeness to a player.
In order to achieve the above object, for example, the following configurations may be employed.
One example of such configurations is a computer-readable non-transitory storage medium having stored therein an information processing program which is executed by a computer of an information processing apparatus for displaying an image of a predetermined object in a virtual space taken by a virtual camera, and the information processing program causes the computer to function as: a determination coordinate setting section, an obstacle determination section, and a detouring section. The determination coordinate setting section sets at least one determination coordinate near the virtual camera. The obstacle determination section determines whether or not an obstacle object which is an object other than the predetermined object is present at least in a predetermined range in a direction based on the predetermined object from the determination coordinate. The detouring section, when the obstacle determination section has determined that the obstacle object is present, moves the virtual camera so that the obstacle object will not be present in the predetermined range.
According to the above configuration example, even if an obstacle or the like is present near a virtual camera for taking an image of a predetermined object such as a player character, a situation in which an image of the player character cannot be taken due to blocking by the obstacle is prevented.
In another configuration example, the information processing program may further cause the computer to function as a virtual camera movement control section configured to move the virtual camera, based on a predetermined condition. The virtual camera movement control section may move the virtual camera, based on operation data indicating the content of operation by a player. The virtual camera movement control section may move the virtual camera, based on movement of the predetermined object moved based on operation data indicating the content of operation by a player. A relative positional relationship between the predetermined object and the virtual camera may be a positional relationship defined in advance.
According to the above configuration example, when an obstacle is present in the movement destination of the virtual camera, the obstacle can be detected in advance and the virtual camera can be moved so as to detour around the obstacle. In addition, for example, in the case where the virtual camera is moved so as to follow a player character, a situation in which the player character cannot be viewed due to blocking by the obstacle is prevented.
In another configuration example, the determination coordinate setting section may set at least one said coordinate at a predetermined coordinate based on a travelling direction of the virtual camera. The determination coordinate setting section may further set said coordinate at a predetermined coordinate based on a direction opposite to the travelling direction of the virtual camera.
According to the above configuration example, for example, in information processing using control in which a movement route of a virtual camera can be predicted, an obstacle present in the travelling direction of the virtual camera can be detected in advance and avoided. In addition, also in the case where the travelling direction can be inversed in the control, an obstacle present in the inversed direction can be avoided.
In another configuration example, the information processing program may further cause the computer to function as a dummy camera placing section configured to place a dummy camera object at a position indicated by the determination coordinate, and the obstacle determination section may determine whether or not the obstacle object is present in an imaging direction of the dummy camera.
According to the above configuration example, even in the case where the virtual camera does not directly contact an obstacle but the obstacle enters the imaging range thereof so that a predetermined object will not be viewed, the virtual camera can detour around the object to take an image.
In another configuration example, the direction based on the predetermined object may be either one of a direction directed from the determination coordinate to the predetermined object and a direction directed from the virtual camera to the predetermined object. The obstacle determination section may determine whether or not the obstacle object is present in a range based on a distance from the virtual camera to the predetermined object.
According to the above configuration example, the presence of an obstacle can be detected in advance, whereby a situation in which imaging of a predetermined object by the virtual camera is blocked by the obstacle can be avoided.
In another configuration example, the obstacle determination section, as well as determining whether or not an obstacle object which is an object other than the predetermined object is present in a predetermined range in a direction based on the predetermined object from the determination coordinate, may further determine whether or not an obstacle object which is an object other than the predetermined object is present in a predetermined range in a direction based on the predetermined object from the position of the virtual object. The detouring section may move the virtual camera so that the obstacle object will not be present either in the predetermined range in the direction based on the predetermined object from the determination coordinate or in the predetermined range in the direction based on the predetermined object from the position of the virtual object.
According to the above configuration example, a situation in which imaging of a predetermined object is blocked by an obstacle entering the imaging range of the virtual camera can be avoided.
In another configuration example, the detouring section may move the virtual camera so that the obstacle object will not be present in the predetermined range, either by rotating the virtual camera around the predetermined object or by making the virtual camera approach the predetermined object.
According to the above configuration example, simple movement control for a virtual camera with a low processing load can be realized.
In another configuration example, the detouring section may gradually move the virtual camera so that the obstacle object will not be present in the predetermined range.
According to the above configuration example, an image presented to a player can be prevented from giving the player a feeling of strangeness due to rapid change.
According to the exemplary embodiments, an image of a virtual space that is easily viewable for a player can be provided.